import http from './interface.js'
//设置请求结束后拦截器
http.interceptor.response = (response) => {
	response = Object.assign(response , response.data );
	console.log('response',response);
	return response;
}
// 请求后端把所有码表内容存起来。

// 用户注册
export const getEveryone = (data) => {
	return http.request({
		url: '/login/getEveryone',
		method: 'GET',
		data
	})
}
export const updateUserStuts = (data) => {
	return http.request({
		url: '/login/updateUserStuts',
		method: 'GET',
		data,
	})
}
export const userMessage = (data) => {
	return http.request({
		url: '/login/userMessage',
		method: 'GET',
		data,
	})
}
export const jianJiFen = (data) => {
	return http.request({
		url: '/login/jianJiFen',
		method: 'POST',
		data,
	})
}
export const findGlobalcodeMap = (data) => {
	return http.request({
		url: '/globalcode/findGlobalcodeMap',
		method: 'GET',
		data,
	})
}
export const delFriend = (data) => {
	return http.request({
		url: '/login/delFriend',
		method: 'GET',
		data,
	})
}
// 发送验证码.
export const sendCode = (data) => {
	return http.request({
		url: '/login/sendCode',
		method: 'POST',
		data,
	})
}
// 发送addJiFen.
export const addJiFen = (data) => {
	return http.request({
		url: '/login/addJiFen',
		method: 'GET',
		data,
	})
}
// 判断当前用户是否还有求助次数
export const getFrequency = (data) => {
	return http.request({
		url: '/login/getFrequency',
		method: 'GET',
		data,
	})
}
// 判断当前用户是否还有求助次数
export const isJiuXu = (data) => {
	return http.request({
		url: '/login/isJiuXu',
		method: 'GET',
		data,
	})
}
// 判断当前用户是否还有求助次数
export const forgetPassword = (data) => {
	return http.request({
		url: '/login/forgetPassword',
		method: 'POST',
		data,
	})
}
// 查看评论列表
export const articleCommentSee = (data) => {
	return http.request({
		url: '/article/articleCommentSee',
		method: 'POST',
		data,
	})
}

// 评论
export const articleComment = (data) => {
	return http.request({
		url: '/article/articleComment',
		method: 'POST',
		data,
	})
}
// 该用户是否点赞接口
export const articleLoveYesOrNo = (data) => {
	return http.request({
		url: '/article/articleLoveYesOrNo',
		method: 'POST',
		data,
	})
}
// 评论无回复
export const articleCommentList = (data) => {
	return http.request({
		url: '/article/articleCommentList',
		method: 'POST',
		data,
	})
}
// qqLogin 参数 code post请求
export const qqLogin = (data) => {
	return http.request({
		url: '/login/qqLogin',
		method: 'POST',
		data,
	})
}
// qqLogin ，  参数 code userId post请求 
export const binDingQQ = (data) => {
	return http.request({
		url: '/login/binDingQQ',
		method: 'POST',
		data,
	})
}

// 默认全部导出  import api from '@/common/vmeitime-http/'
export default {
	getEveryone,
	updateUserStuts,
	userMessage,
	jianJiFen,
	findGlobalcodeMap,
	delFriend,
	sendCode,
	addJiFen,
	getFrequency,
	isJiuXu,
	forgetPassword,
	articleCommentSee,
	articleComment,
	articleLoveYesOrNo,
	articleCommentList,
	qqLogin,
	binDingQQ
}
